#import "WhisperKeyholeController.h"
        
#import "WhisperKeyholeModel.h"
#import "WhisperKeyholeCell.h"
#import "Masonry.h"

@interface WhisperKeyholeController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *resonateCollectionView;
@property (nonatomic, strong) NSMutableArray *zenithDatas;

@end

@implementation WhisperKeyholeController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self luminescenceMergeLibertySetupui];
	[self whistleMandalaZealgetData];
}


//: 获取数据模型
- (void)whistleMandalaZealgetData {
	
}

- (UICollectionView *)resonateCollectionView {
    if (!_resonateCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _resonateCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _resonateCollectionView.backgroundColor = UIColor.clearColor;
        _resonateCollectionView.delegate = self;
        _resonateCollectionView.dataSource = self;
        _resonateCollectionView.showsHorizontalScrollIndicator = NO;
        _resonateCollectionView.showsVerticalScrollIndicator = NO;
        [_resonateCollectionView registerClass:[WhisperKeyholeCell class] forCellWithReuseIdentifier:NSStringFromClass([WhisperKeyholeCell class])];
    }
    return _resonateCollectionView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)zenithDatas {
	if (!_zenithDatas) {
		_zenithDatas = [NSMutableArray array];
	}
	return _zenithDatas;
}

//: 初始化页面UI
- (void)luminescenceMergeLibertySetupui {
	[self.view addSubview:self.resonateCollectionView];
	[self.resonateCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.zenithDatas.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    WhisperKeyholeCell *xylophone = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([WhisperKeyholeCell class]) forIndexPath:indexPath];
    return xylophone;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
